package com.bw.rjx.mapper;

import com.bw.rjx.bean.ActivityReduceStats;
import com.bw.rjx.bean.CommodityIndicators;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public interface GetDataServiceMapper {
    @Select("select sum(order_activity_reduce_amount)                   activity_reduce_amount,\n" +
            "       sum(order_origin_total_amount)                      origin_total_amount,\n" +
            "       round(round(toFloat64(activity_reduce_amount), 5) /\n" +
            "             round(toFloat64(origin_total_amount), 5), 20) subsidyRate\n" +
            "from dws_trade_order_window\n" +
            "where toYYYYMMDD(stt) = #{date}\n" +
            "group by toYYYYMMDD(stt);")
    List<ActivityReduceStats> selectActivityStats(@Param(value = "date") Integer date);

    List<CommodityIndicators> getCommodityIndicators(  @Param(value = "shopId") String shopId,  // 第1个参数：shopId
                                                       @Param(value = "skuId") String skuId,    // 第2个参数：skuId
                                                       @Param(value = "dt") String dt           // 第3个参数：dt（关键！指定名称为dt）
    );
}
